<template>
	<view>
		<view style="background: #fff;" @click="go(item)" v-for="(item,index) in list" :key="index">

			<view v-if="!item.ad" class="u-padding-30 u-border-bottom">
				<view class="u-flex u-row-between">
					<view class="u-flex u-flex-3">
						<u-tag  bg-color="#FFD1CC" text="置顶" type="error" v-if="item.top" />
						<view style="width: 450rpx;" class="u-font-30 u-margin-left-20 u-font-weight u-line-1">{{item.title}}</view>
					</view>
					<view class="u-font-weight" :style=" item.staus==1?'color:#FFD23C':'color:#3C97FF'">
						{{item.status==1?'进行中':'已结束'}}
					</view>
				</view>
				<view style="display: flex;padding: 20rpx 0;">
					<view>
						<u-image shape="circle" :src="item.headimg" width="100" height="100"></u-image>
					</view>
					<view class="u-margin-left-20">
						<view class="u-type-info">{{item.contacts}}</view>
						<view class="u-margin-top-20 ">{{item.content}}</view>
					</view>
				</view>

				<view class="u-flex u-row-between">
					<view>
						<u-icon name="map-fill" color="#3C97FF"></u-icon>
						<text class="u-type-info u-margin-left-10">{{item.province}}{{item.city}}</text>
					</view>
					<view v-if="NoMy" @click.stop="call(item)"
						style="background: #D8EAFF;padding: 7rpx 14rpx;color: #fff;border-radius: 10rpx;">
						<u-icon name="phone-fill" color="#3C97FF"></u-icon>
						<text style="color:#3C97FF ;" class="u-margin-left-10">联系老板</text>
					</view>

				</view>
			</view>

			<view v-else>
				<u-image :src="item.cover" height="300"></u-image>
			</view>
</view>
		</view>
</template>

<script>
	import wxpay from '@/common/wxpay.js';
	export default {
		name: "workList",
		props: {
			list: {
				type: Array,
				default: () => [],
			},
			NoMy: {
				type: Boolean,
				default: true
			}


		},
		data() {
			return {

			}
		},
		methods: {
			go(e) {
				uni.navigateTo({
					url: '/pages/findWork/detail?id=' + e.id
				})
			},
			call(item) {
				this.$u.post('/user/contactJob', {
					id: item.id
				}).then(res => {
					uni.makePhoneCall({
						phoneNumber: res
					})
				}).catch(err => {
                    setTimeout(()=>{
                    	uni.navigateTo({
                    		url:'/pages/myIntegral/recharge'
                    	})
                    },1500)
                    return
				})
			}
		},

	}
</script>

<style>
</style>
